//
//  LKTaiQianScanBindController.m
//  Mideleague_Shop
//
//  Created by Zhiwang on 2020/7/17.
//  Copyright © 2020 Zhiwang. All rights reserved.
//

#import "LKTaiQianScanBindController.h"
#import "LKTaiQianEditViewController.h"
@interface LKTaiQianScanBindController ()

@end

@implementation LKTaiQianScanBindController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"台签绑定";
    [self crateUI];
    // Do any additional setup after loading the view.
}
-(void)crateUI{
    WS(weakSelf)
    LKBaseLabel *headerLabel = [LKBaseLabel labelWithFrame:CGRectZero text:[NSString stringWithFormat:@"台签编号:%@",self.no_number] textColor:[UIColor blackColor] font:[UIFont fontWithName:@"PingFangSC-Regular" size:15] textAlignment:NSTextAlignmentCenter];
    [self.view addSubview:headerLabel];
    [headerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(20);
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.view.mas_top).offset(NAVIGATION_BAR_HEIGHT + 50);
    }];

    LKBaseLabel *contenLabel = [LKBaseLabel labelWithFrame:CGRectZero text:@"" textColor:[UIColor blackColor] font:[UIFont fontWithName:@"PingFangSC-Regular" size:15] textAlignment:NSTextAlignmentCenter];
    [self.view addSubview:contenLabel];
    [contenLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-20);
        make.left.equalTo(headerLabel.mas_left);
        make.top.equalTo(headerLabel.mas_bottom).offset(20);
    }];
    if ([self.status isEqualToString:@"0"]) {
        contenLabel.text = [NSString stringWithFormat:@"台签状态:未激活"];
    }else{
        contenLabel.text = [NSString stringWithFormat:@"台签状态:已激活"];
    }
    LKBaseButton *saveBtn = [LKBaseButton buttonWithFrame:CGRectMake(0, 0, 64, 24) type:UIButtonTypeCustom title:@"立即激活" titleColor:[UIColor whiteColor] layercorne:20 font:[UIFont fontWithName:@"PingFangSC-Regular" size: 16] backgroudColor:[UIColor redColor] AndActionBlock:^(UIButton * _Nonnull btn) {
//        NSMutableDictionary *param = [[NSMutableDictionary alloc] initWithDictionary:@{}];
//          NSString *sign = [NSString encoingWithDic:param];
//          [param setObject:sign forKey:@"sign"];
//          btn.enabled = NO;
//          [[LKNetDataManager defaultManager] sendRequestMethod:HTTPMethodPOST serverUrl:ServerlUrl apiPath:MyTaiqianEditUrl header:[LKUserInforTool account].token parameters:param progress:^(NSProgress * _Nullable progress) {
//
//          } success:^(BOOL isSuccess, id  _Nullable responseObject) {
//              if ([responseObject[@"code"] isEqualToString:@"success"]) {
//
//              }else{
//                  [SVProgressHUD showInfoWithStatus:responseObject[@"msg"]];
//              }
//          } failure:^(NSString * _Nullable errorMessage) {
//
//          }];
        LKTaiQianEditViewController *vc = [[LKTaiQianEditViewController alloc] init];
        vc.cate_id = weakSelf.Id;
        vc.operateStyle = LKTaiqianOperateStyleAdd;
        [weakSelf.navigationController pushViewController:vc animated:YES];
    }];
    [self.view addSubview:saveBtn];
    [saveBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(contenLabel.mas_bottom).offset(20);
        make.left.equalTo(self.view.mas_left).offset(50);
        make.height.mas_equalTo(40);
    }];
    if ([self.status isEqualToString:@"0"]) {
        [saveBtn setTitle:@"立即激活" forState:UIControlStateNormal];
    }else{
        [saveBtn setTitle:@"已经激活" forState:UIControlStateNormal];
    }
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
